/**
 * File: cs3343-Satir-Therapy/src/programtest/BoardProcessorTest.java
 *  
 * @author Lai Hing Hung, Dennis					Revision no: 1.0
 * @category test case
 * 
 * Checked in at date: 2012/03/
 * Log: testIsToolGrid(), testIsEventGrid(), testIsSayAndActionGrid()
 */
package programtest;
import junit.framework.*;
import program.*;

/**
 * @author Lai Hing Hung, Dennis
 * @category test case
 *
 */
public class BoardProcessorTest extends TestCase {
	
	public void testIsToolGrid(){
		BoardProcessor boardProcessor = new BoardProcessor();
		
		// check whether boardProcessor can recognize grid 6 as a magic tool grid
		assertEquals(boardProcessor.isMagicToolGrid(6), true);
		// check whether boardProcessor can recognize grid 13 as a magic tool grid
		assertEquals(boardProcessor.isMagicToolGrid(13), true);
		// check whether boardProcessor can recognize grid 23 as a magic tool grid
		assertEquals(boardProcessor.isMagicToolGrid(23), true);
		
		// check whether boardProcessor would recognize an event grid (e.g 2) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(3), false);
		// check whether boardProcessor would recognize an event grid (e.g 12) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(12), false);
		// check whether boardProcessor would recognize an event grid (e.g 21) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(21), false);
		// check whether boardProcessor would recognize an event grid (e.g 27) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(27), false);
		
		// check whether boardProcessor would recognize a say/action grid (e.g 3) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(4), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 10) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(10), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 17) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(17), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 19) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(19), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 25) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(25), false);
		
		// check whether boardProcessor would recognize a normal grid (e.g 1) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(1), false);
		// check whether boardProcessor would recognize a normal grid (e.g 14) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(14), false);
		// check whether boardProcessor would recognize a normal grid (e.g 28) as a tool grid
		assertEquals(boardProcessor.isMagicToolGrid(28), false);
	}
	
	public void testIsEventGrid(){
		BoardProcessor boardProcessor = new BoardProcessor();
		
		// check whether boardProcessor can recognize grid 2 as an event grid
		assertEquals(boardProcessor.isEventGrid(3), true);
		// check whether boardProcessor can recognize grid 12 as an event grid
		assertEquals(boardProcessor.isEventGrid(12), true);
		// check whether boardProcessor can recognize grid 21 as an event grid
		assertEquals(boardProcessor.isEventGrid(21), true);
		// check whether boardProcessor can recognize grid 27 as an event grid
		assertEquals(boardProcessor.isEventGrid(27), true);
		
		// check whether boardProcessor would recognize a magic tool grid (e.g 6) as an event grid
		assertEquals(boardProcessor.isEventGrid(6), false);
		// check whether boardProcessor would recognize a magic tool grid (e.g 13) as an event grid
		assertEquals(boardProcessor.isEventGrid(13), false);
		// check whether boardProcessor would recognize a magic tool grid (e.g 23) as an event grid
		assertEquals(boardProcessor.isEventGrid(23), false);
		
		// check whether boardProcessor would recognize a say/action grid (e.g 4) as an event grid
		assertEquals(boardProcessor.isEventGrid(4), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 10) as an event grid
		assertEquals(boardProcessor.isEventGrid(10), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 17) as an event grid
		assertEquals(boardProcessor.isEventGrid(17), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 19) as an event grid
		assertEquals(boardProcessor.isEventGrid(19), false);
		// check whether boardProcessor would recognize a say/action grid (e.g 25) as an event grid
		assertEquals(boardProcessor.isEventGrid(25), false);
		
		// check whether boardProcessor would recognize a normal grid (e.g 1) as an event grid
		assertEquals(boardProcessor.isEventGrid(1), false);
		// check whether boardProcessor would recognize a normal grid (e.g 14) as an event grid
		assertEquals(boardProcessor.isEventGrid(14), false);
		// check whether boardProcessor would recognize a normal grid (e.g 28) as an event grid
		assertEquals(boardProcessor.isEventGrid(28), false);
	}
	
	public void testIsSayAndActionGrid(){
		BoardProcessor boardProcessor = new BoardProcessor();
		
		// check whether boardProcessor can recognize grid 4 as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(4), true);
		// check whether boardProcessor can recognize grid 10 as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(10), true);
		// check whether boardProcessor can recognize grid 17 as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(17), true);
		// check whether boardProcessor can recognize grid 19 as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(19), true);
		// check whether boardProcessor can recognize grid 25 as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(25), true);
		
		// check whether boardProcessor can recognize a magic tool grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(6), false);		
		// check whether boardProcessor can recognize a magic tool grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(13), false);
		// check whether boardProcessor can recognize a magic tool grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(23), false);
		
		// check whether boardProcessor can recognize an event grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(3), false);
		// check whether boardProcessor can recognize an event grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(12), false);
		// check whether boardProcessor can recognize an event grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(21), false);
		// check whether boardProcessor can recognize an event grid as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(27), false);
		
		// check whether boardProcessor would recognize a normal grid (e.g 1) as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(1), false);
		// check whether boardProcessor would recognize a normal grid (e.g 14) as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(14), false);
		// check whether boardProcessor would recognize a normal grid (e.g 28) as a say/action grid
		assertEquals(boardProcessor.isSayAndActionGrid(28), false);
	}
}
